﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace UnitTest.TaskSafetyDemo
{
    public class TaskSafety3
    {
        public static void Go()
        {
            int iResult = 0;
            for (int i = 0; i < 10000; i++)
            {
                Task.Run(() =>
                {
                    Thread.Sleep(300);
                    iResult++;
                });
            }
            Thread.Sleep(5000);
            Console.WriteLine(iResult);
        }

        public async Task DoAsync()
        {

        }
    }
}
